<!DOCTYPE html>
<html
  layout:decorator="components/layout"
  xmlns="http://www.w3.org/1999/xhtml"
  xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
  lang="zh-CN"
>
<head>
  <title>服务器管理</title>
</head>
<body>
<div
  layout:fragment="content"
  class="container"
>
  <div id="app" v-cloak>
    <div class="container">
      <div class="myHeader">
        <div class="myHeader-title">
          修改服务器信息
        </div>
      </div>
      <table
        width="100%"
        border="0"
        class="el-table el-table--border"
        cellspacing="0"
        cellpadding="0"
      >
        <tbody>

        <tr>
          <td
            width="200"

          >所在机房<span style="color:red">*</span>
          </td>
          <td>
            <el-select
              v-model="formData.houseId"
              v-validate="'required'"
              name="houses"
            >
              <el-option
                v-for="house in houses"
                :value="house.id"
                :key="house.id"
                :label="house.houseName"
              ></el-option>
            </el-select>
            <div
              id="houses_message"
              class="msg"
            >
              <span class="field-error" v-show="errors.has('houses:required')">请选择所在机房</span>
            </div>
          </td>
        </tr>

        <tr>
          <td
            width="200"

          >所在分区<span style="color:red">*</span>
          </td>
          <td>
            <el-select
              v-model="formData.area"
              v-validate="'required'"
              name="areas"
            >
              <el-option
                v-for="[key,val] in areaMap"
                :value="key"
                :key="key"
                :label="val"
              ></el-option>
            </el-select>
            <div
              id="areas_message"
              class="msg"
            >
              <span class="field-error" v-show="errors.has('areas:required')">请选择所在分区</span>
            </div>
          </td>
        </tr>

        <tr>
          <td
            width="200"

          >所在机架<span style="color:red">*</span>
          </td>
          <td>
            <el-select
              v-model="formData.frame"
              v-validate="'required'"
              name="frames"
            >
              <el-option
                v-for="[key,val] in frameMap"
                :value="key"
                :key="key"
                :label="val"
              ></el-option>
            </el-select>
            <div
              id="frames_message"
              class="msg"
            >
              <span class="field-error" v-show="errors.has('frames:required')">请选择所在机架</span>
            </div>
        </tr>

        <tr>
          <td
            width="200"

          >所在机位<span style="color:red">*</span>
          </td>
          <td>
            <el-select
              v-model="formData.position"
              v-validate="'required'"
              name="positions"
            >
              <el-option
                v-for="[key,val] in positionMap"
                :value="key"
                :key="key"
                :label="val"
              ></el-option>
            </el-select>
            <div
              id="positions_message"
              class="msg"
            >
              <span class="field-error" v-show="errors.has('positions:required')">请选择所在机位</span>
            </div>
          </td>
        </tr>

        <tr>
          <td>服务器编号<span style="color:red">*</span></td>
          <td>
            <el-input
              name="serverNumber"
              v-validate="'required|max:30|server_number_validate'"
              v-model="formData.serverNumber"
              data-vv-delay="1000"
              maxlength="30"
              show-word-limit
            ></el-input>
            <div
              id="serverNumber_message"
              class="msg"
            >
              <span class="field-error" v-show="errors.has('serverNumber:required')">请填写服务器编号</span>
              <span class="field-error" v-show="errors.has('serverNumber:max')">服务器编号长度最大为 30 位</span>
              <span class="field-error" v-show="errors.has('serverNumber:server_number_validate')">服务器编号已存在</span>
            </div>
          </td>
        </tr>
        <tr>
          <td>服务器名称<span style="color:red">*</span></td>
          <td>
            <el-input
              name="serverName"
              v-validate="'required|max:50'"
              v-model="formData.serverName"
              maxlength="50"
              show-word-limit
            ></el-input>
            <div
              id="serverName_message"
              class="msg"
            >
              <span class="field-error" v-show="errors.has('serverName:required')">请填写服务器名称</span>
              <span class="field-error" v-show="errors.has('serverName:max')">服务器名称长度最大为 30 位</span>
            </div>
          </td>
        </tr>
        <tr>
          <td>服务器IP<span style="color:red">*</span></td>
          <td>
            <el-input
              name="ip"
              v-validate="'required|ip'"
              v-model="formData.ip"
            ></el-input>
            <div
              id="ip_message"
              class="msg"
            >
              <span class="field-error" v-show="errors.has('ip:required')">请填写服务器IP</span>
              <span class="field-error" v-show="errors.has('ip:ip')">{{ errors.first('ip') }}</span>
            </div>
          </td>
        </tr>
        <tr>
          <td>使用用户<span style="color:red">*</span></td>
          <td>
            <el-select
              v-model="formData.useUser"
              v-validate="'required'"
              name="useUser"
            >
              <el-option
                v-for="[key,val] in customerMap"
                :value="key"
                :label="val"
                :key="key"
              ></el-option>
            </el-select>
            <div
              id="useUser_message"
              class="msg"
            >
              <span class="field-error" v-show="errors.has('useUser:required')">请选择使用用户</span>
            </div>
          </td>
        </tr>
        <tr>
          <td>服务器规格</td>
          <td>
            <el-input
              v-model="formData.standard"
              maxlength="50"
              show-word-limit
            ></el-input>
          </td>
        </tr>
        <tr>
          <td>服务器型号</td>
          <td>
            <el-input
              v-model="formData.model"
              maxlength="50"
              show-word-limit
            ></el-input>
          </td>
        </tr>
        <tr>
          <td>操作系统</td>
          <td>
            <el-input
              v-model="formData.os"
              maxlength="50"
              show-word-limit
            ></el-input>
          </td>
        </tr>
        <tr>
          <td>CPU描述</td>
          <td>
            <el-input
              v-model="formData.cpu"
              maxlength="50"
              show-word-limit
            ></el-input>
          </td>
        </tr>
        <tr>
          <td>内存描述</td>
          <td>
            <el-input
              v-model="formData.memoryDesc"
              maxlength="50"
              show-word-limit
            ></el-input>
          </td>
        </tr>
        <tr>
          <td>硬盘描述</td>
          <td>
            <el-input
              v-model="formData.diskDesc"
              maxlength="50"
              show-word-limit
            ></el-input>
          </td>
        </tr>
        <tr>
          <td>网卡数量</td>
          <td>
            <el-input
              name="ncNumber"
              v-validate="'numeric|max:9'"
              v-model="formData.ncNumber"
              maxlength="9"
              show-word-limit
            ></el-input>
            <span class="field-error" v-show="errors.has('ncNumber')">{{ errors.first('ncNumber') }}</span>
          </td>
        </tr>
        <tr class="J-datepicker u">
          <td>使用日期</td>
          <td>
            <el-date-picker
              v-model="formData.useDate"
              type="datetime"
              placeholder="选择日期时间"
            >
            </el-date-picker>
          </td>
        </tr>
        <tr class="J-datepicker t">
          <td>到期日期</td>
          <td>
            <el-date-picker
              v-model="formData.terminateDate"
              type="datetime"
              placeholder="选择日期时间"
            >
            </el-date-picker>
          </td>
        </tr>
        <tr>
          <td>备注</td>
          <td>
            <el-input
              type="textarea"
              v-model="formData.comments"
              maxlength="100"
              show-word-limit
            ></el-input>
          </td>

        </tr>
        </tbody>
      </table>
      <div align="center">
        <el-button
          type="primary"
          @click="submitForm"
        >确认
        </el-button>
        <el-button
          @click="_forward('/basic-data/admin_servers')"
        >返回
        </el-button>
      </div>
    </div>
  </div>
</div>
<div layout:fragment="js">
  <script src="/static/js/module/basic-data/model/BaseServerInfo.js"></script>
  <script src="/static/js/component/BaseValidateVue.js"></script>
  <script src="/static/js/module/basic-data/api/baseCustomerApi.js"></script>
  <script src="/static/js/module/basic-data/api/basePositionApi.js"></script>
  <script src="/static/js/module/basic-data/api/baseServerInfoApi.js"></script>
  <script src="/static/js/module/basic-data/api/baseHouseInfoApi.js"></script>
  <script src="/static/js/module/basic-data/api/baseFrameInfoApi.js"></script>
  <script src="/static/js/module/basic-data/api/baseIdcHouseAreaApi.js"></script>
  <script src="/static/js/module/basic-data/modify/admin_servers_modify.js"></script>
</div>
</body>
</html>
